import request from '@/utils/request'

// 查询栏目信息列表
export function listArticle(query) {
  return request({
    url: '/docs/article/list',
    method: 'get',
    params: query
  })
}

// 查询栏目信息详细
export function getArticle(articleId) {
  return request({
    url: '/docs/article/' + articleId,
    method: 'get'
  })
}

// 新增栏目信息
export function addArticle(data) {
  return request({
    url: '/docs/article',
    method: 'post',
    data: data
  })
}

// 修改栏目信息
export function updateArticle(data) {
  return request({
    url: '/docs/article',
    method: 'put',
    data: data
  })
}
export function changeArticleStatus(articleId, status) {
    const  data = {
        articleId,
        status
    }
    return request({
        url: '/docs/article/changeArticleStatus',
        method: 'put',
        data: data
    })
}

// 删除栏目信息
export function delArticle(articleId) {
  return request({
    url: '/docs/article/' + articleId,
    method: 'delete'
  })
}

export function columnTree(type) {
  return request({
    url: '/docs/article/columnTree/'+type,
    method: 'get'
  })
}


export function getArticleTree(data) {
    return request({
        url: '/docs/article/getArticleTree',
        method: 'post',
        data: data
    })
}
export function getMpArticle(data) {
    return request({
        url: '/docs/article/getMpArticle',
        method: 'post',
        data: data
    })
}
